package sd.zhr.moodcapsule.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sd.zhr.moodcapsule.mapper.MoodCommentMapper;
import sd.zhr.moodcapsule.pojo.MoodComment;

import java.util.List;

@Service
public class MoodCommentServiceImpl {
    @Autowired
    MoodCommentMapper moodCommentMapper;

    public List<MoodComment> getMoodComments(Integer moodId) {
        return moodCommentMapper.selectAllByCapsuleId(moodId);
    }
    public int addMoodComment(MoodComment moodComment) {
        return moodCommentMapper.insert(moodComment);
    }
    public int deleteMoodComment(Integer moodCommentId) {
        return moodCommentMapper.deleteByPrimaryKey(moodCommentId);
    }
    public int updateMoodComment(MoodComment moodComment) {
        return moodCommentMapper.updateByPrimaryKey(moodComment);
    }
}
